MessageSearchViewModel

open class MessageSearchViewModel : BaseViewModel, LifecycleObserver, OnPagedDataLoader<T>

ViewModel preparing and managing data to search a message in a channel since 3.0.0

Constructors

Link copied to clipboard
open fun MessageSearchViewModel(@NonNull channelUrl: String, @Nullable query: MessageSearchQuery)
Constructor

Functions

Link copied to clipboard
open fun authenticate(@NonNull handler: AuthenticateHandler)
Tries to connect Sendbird Server and retrieve a channel instance.
Link copied to clipboard
protected open fun createMessageSearchQuery(@NonNull keyword: String): MessageSearchQuery
Creates message search query.
Link copied to clipboard
open fun getKeyword(): String
Returns the keyword used in the most recent query.
Link copied to clipboard
open fun getSearchResultList(): LiveData<List<BaseMessage>>
Returns LiveData that can be observed for the list of messages that were searched.
Link copied to clipboard
open fun hasNext(): Boolean
Determine whether the data on the next page exists.
Link copied to clipboard
open fun hasPrevious(): Boolean
Returns false as the message search do not support to load for the previous by default.
Link copied to clipboard
open fun loadNext(): List<BaseMessage>
Requests the list of BaseMessages to be searched.
Link copied to clipboard
open fun loadPrevious(): List<BaseMessage>
Returns the empty list as the message search do not support to load for the previous by default.
Link copied to clipboard
open fun search(@NonNull keyword: String, @Nullable handler: OnListResultHandler<BaseMessage>)
Searches for messages using keyword.

Properties

Link copied to clipboard
open val channel: GroupChannel
Link copied to clipboard
val channelUrl: String